package com.mine.modules.sys.domain.vo;

import com.mine.modules.sys.entity.SysPermission;
import lombok.Data;

@Data
public class MetaProp {

    /**
     * meta ==> 路由菜单元信息
     * meta.icon ==> 菜单和面包屑对应的图标
     * meta.title ==> 路由标题 (用作 document.title || 菜单的名称)
     * meta.activeMenu ==> 当前路由为详情页时，需要高亮的菜单
     * meta.isLink ==> 路由外链时填写的访问地址
     * meta.isHide ==> 是否在菜单中隐藏 (通常列表详情页需要隐藏)
     * meta.isFull ==> 菜单是否全屏 (示例：数据大屏页面)
     * meta.isAffix ==> 菜单是否固定在标签页中 (首页通常是固定项)
     * meta.isKeepAlive ==> 当前路由是否缓存
     * */

    private String icon;
    private String title;
    private String activeMenu;
    private String isLink;
    private boolean isHide;
    private boolean isFull;
    private boolean isAffix;
    private boolean isKeepAlive;

    public MetaProp(SysPermission sysPermission) {
        this.icon = sysPermission.getIcon();
        this.title = sysPermission.getName();
        this.activeMenu = "";
        this.isLink = sysPermission.getRedirect();
        this.isHide = false;
        this.isFull = false;
        this.isAffix = true;
        this.isKeepAlive = false;
    }
}
